<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<title>个人信息</title>
		<%@include file="/WEB-INF/base.jspf"%>
		<style type="text/css">
			input,button{margin-top: 40px;}
			*{font-size: 14px;}
			li{height: 60px;line-height: 60px;border-top: 1px solid #f2f2f2;}
			th,td{text-align: center;}
			tr{background: white;height: 30px;}
			.tr1 *{font-size: 16px;}
		</style>
	</head>

	<body style="background: #F1F1F1 ;">
		<div class="col-xs-12 col-sm-4 col-sm-offset-4 text-center bg-theme" style="height: 50px;line-height:50px;position: fixed;margin-top: 0px;left: 0px;z-index: 100;">
			<strong style="font-size: 20px;">下注记录</strong>
		</div>
		<div class="col-xs-12 col-sm-4 col-sm-offset-4" style="padding: 0px;">
			<div style="height: 50px;"></div>
			<table style="width: 100%;">
				<c:if test="${myOrders.size()==0 }"><div style="text-align: center;line-height: 100px;">您还没有任何记录，请先去<a href="/gc.do" style="font-weight: bold;color: blue;">下注</a></div></c:if>
				<c:forEach items="${myOrders }" var="order" varStatus="i" >
					<tr class="tr tr1" text="${i.index+1 }" style="border-top: 1px solid #F1F1F1 ;">
						<td>${order.cname1 }</td>
						<td>${order.period }</td>
						<td>${order.acount }
							<c:if test="${order.acount!=null }">元</c:if>
						</td>
					</tr>
					<tr class="tr" text="${i.index+1 }" style="color: silver ;">
						<td>共 ${order.lottercount } 注</td>
						<td>${order.orderdate }</td>
						<td>
							<c:if test="${order.state==0 }"><span style="color: red;">待付款</span></c:if>
							<c:if test="${order.state==1 }"><span style="color: blue;">待开奖</span></c:if>
							<c:if test="${order.state==2 }"><span style="color: red;">未中奖</span></c:if>
							<c:if test="${order.state==3 }"><span style="color: green;font-weight: bold;">中奖${order.goalmoney }元</span></c:if>
						</td>
					</tr>
					<tr class="xx${i.index+1 } hidden xxxx">
						<td colspan="4" style="background: silver;text-align: left;padding-left: 20px;">
							玩　　法：<%-- ${order.cplay1 } --%><a class="btn btn-danger fr" style="margin-top : 5px;margin-right: 20px;" href="javascript:del(${order.id })" >删除</a><br>
							开奖号码：<c:if test="${order.lotternum!=null }">${order.lotternum }</c:if><c:if test="${order.lotternum==null }">等待开奖</c:if><br>
							下注号码
							<c:if test="${order.str1!='' }"><span style="color: silver;">　</span>1：${order.str1 } </c:if>
							<c:if test="${order.str2!='' }"><br><span style="color: silver;">下注号码 　</span>2：${order.str2 } </c:if>
							<c:if test="${order.str3!='' }"><br><span style="color: silver;">下注号码 　</span>3：${order.str3 } </c:if>
							<c:if test="${order.str4!='' }"><br><span style="color: silver;">下注号码 　</span>4：${order.str4 } </c:if>
							<c:if test="${order.str5!='' }"><br><span style="color: silver;">下注号码 　</span>5：${order.str5 } </c:if>
							<c:if test="${order.str6!='' }"><br><span style="color: silver;">下注号码 　</span>6：${order.str6 } </c:if>
							<c:if test="${order.str7!='' }"><br><span style="color: silver;">下注号码 　</span>7：${order.str7 } </c:if>
							<c:if test="${order.str8!='' }"><br><span style="color: silver;">下注号码 　</span>8：${order.str8 } </c:if>
							<c:if test="${order.str9!='' }"><br><span style="color: silver;">下注号码 　</span>9：${order.str9 } </c:if>
							<c:if test="${order.str10!='' }"><br><span style="color: silver;">下注号码 　</span>10：${order.str10 } </c:if>
						</td>
					</tr>
				</c:forEach>
			</table>
			<br>
			<br>
			<br>
		</div>
		<div class="col-xs-12 col-sm-4 col-sm-offset-4 text-center foot">
			<iframe src="f.jsp"></iframe>
		</div>
	</body>
	<script type="text/javascript">
		$(".tr").click(function(){
			$h=$(".xx"+$(this).attr("text"));
			if($h.attr("class").indexOf("hidden")!=-1){
				$h.removeClass("hidden")
			}else{$h.addClass("hidden")}
		});
		function del(id){
			if(confirm("确定删除这条记录吗？")==true){
				ajax({
					url:'/order/delOrderById.do?id='+id,
					type:'post',
					success:function(data){
						var json=eval('('+data+')');
						if(json.data==1){location.reload();}
						else{alert("删除失败")}
					},
					error:function(){alert("发生未知错误");}
				});
			}
		}
		window.onload=function () {
			
		    document.addEventListener('touchstart',function (event) {
		        if(event.touches.length>1){
		            event.preventDefault();
		        }
		    })
		    var lastTouchEnd=0;
		    document.addEventListener('touchend',function (event) {
		        var now=(new Date()).getTime();
		        if(now-lastTouchEnd<=300){
		            event.preventDefault();
		        }
		        lastTouchEnd=now;
		    },false)
		}	
	</script>
</html>